<script language="JavaScript" type="text/javascript">
<!--
function chkFormular() {
	if(document.getElementById('topicname').value == "") {
		alert("%enter_topic%");
		document.getElementById('topicname').focus();
   		return false;
	}
	
	if(document.getElementById('message').value == "") {
		alert("%enter_text%");
		document.getElementById('message').focus();
   		return false;
	}
	if(!validbbcode(document.getElementById('message').value)){
		return false;
	}
  if(!validbbcode(document.getElementById('fp_title').value)){
    return false;
  }

  if(!validbbcode(document.getElementById('fp_options').value)){
    return false;
  }

  if(document.getElementById('fp_title').value == "" && document.getElementById('fp_options').value == "") {
    return true;
  }
  else {
    if(document.getElementById('fp_title').value == "") {
      alert("%fp_enter_title%");
      document.getElementById('fp_title').focus();
      return false;
    }
    if(document.getElementById('fp_options').value == "") {
      alert("%fp_enter_options%");
      document.getElementById('fp_options').focus();
      return false;
    }
  }

}
	
-->
</script>

<form action="forum_topic.php?board=$board&amp;topic=$topic" method="post" id="post" name="post" onsubmit="return chkFormular()">
<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="$border">
  <tr>
    <td class="title" align="center" bgcolor="$bghead">%edit_topic%</td>
  </tr>
  <tr><td bgcolor="$pagebg"></td></tr>
  <tr>
    <td bgcolor="$bg1">
    <table width="100%" align="center" cellpadding="2" cellspacing="0">
      <tr>
        <td colspan="2">
        <table width="100%" cellpadding="0" cellspacing="0">
          <tr>
            <td colspan="15"><b>%topic_icon%:</b></td>
          </tr>
          <tr>
            <td colspan="8"></td>
          </tr>
          $iconlist
        </table>
        </td>
      </tr>
      <tr>
        <td colspan="2"><b>%subject%:</b><br /></td>
      </tr>
      <tr>
        <td colspan="2"><input name="topicname" type="text" id="topicname" style="width:99%;" value="$topicname" size="45" /></td>
      </tr>
      <tr>
        <td colspan="2">$addbbcode</td>
      </tr>
      <tr>
        <td colspan="2"><textarea name="message" id="message" rows="10" cols="35" style="width:99%;">$message</textarea></td>
      </tr>
      <tr>
      <td colspan="2"><iframe width="100%" height="110px" frameborder="0" src="http://beta.skyleaguestudio.com/imgup/"></iframe></td>
      </tr>
      <tr>
        <td colspan="2"><small><b>%options%:</b> &#8226; %html_off% &#8226; %bbcode_on% &#8226; %smilies_on%</small></td>
      </tr>
      <tr>
        <td colspan="2">$notify
        $chk_sticky</td>
      </tr>
      <tr><td colspan="2"><br /></td></tr>
      <tr>
      <td>
        <table width="95%" border="0" cellspacing="0" cellpadding="2">
          <tr>
          <td colspan="2" class="title" align="center" bgcolor="$bghead">%fp_poll_creation%</td>
          </tr>
          <tr><td colspan="2" bgcolor="$pagebg"></td></tr>
          <tr>
          <td valign="top" align="left" width="40%"><strong>%fp_title%:</strong></td>
          <td valign="top"><input name="fp_title" id="fp_title" type="text" value="$fp_title" size="60" maxlength="75" /></td>
          </tr>
          <tr>
          <td align="left" valign="top"><strong>%fp_ending_time%:</strong><br/>hh:mm DD.MM.YYYY</td>
          <td valign="top">
          <select name="fp_hour" id="fp_hour">$fp_hour</select>
          :
          <select name="fp_minute" id="fp_minute">$fp_minute</select>
          %fp_on%
          <select name="fp_day" id="fp_day">$fp_day</select>
          <select name="fp_month" id="fp_month">$fp_month</select>
          <select name="fp_year" id="fp_year">$fp_year</select><br/>
          </td>
          </tr>
          <tr>
          <td align="left" valign="top"><strong>%fp_options%:</strong><br/>%fp_options_desc%<br/>%fp_enter_options%</td>
          <td valign="top">
            %fp_edit_option%<br/>
            <textarea name="fp_options" id="fp_options" rows="5" cols="10" style="width:99%;">$fp_options</textarea>
          </td>
          </tr>
        </table>		  
        </td>
        <td align="right" valign="bottom">
          <input type="hidden" name="post" value="$post" />
          <input type="hidden" name="saveedittopic" value="true" />
          <input name="updatetopic" type="submit" value="%edit_topic%" />
       </td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</form>